<!--
	作者：weixin
	时间：2017-03-28
	描述：企业用户绑定自己所属的公司，如果没有则要新加公司
-->
<!DOCTYPE HTML>
<html>

	<head>
		<meta content="no-siteapp" http-equiv="Cache-Control">
		<link media="handheld" rel="alternate">
		<!-- end 云适配 -->
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
		<title>申请认证-招聘服务-拉勾网-最专业的互联网招聘平台</title>

		<script type="text/javascript">
			console.log(1);
		</script>
		<link href="${rc.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
		<link href="${rc.contextPath}/css/style.css" type="text/css" rel="stylesheet">
		
		
		<link rel="stylesheet" href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
  <script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
		
		<link href="${rc.contextPath}/css/popup.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="${rc.contextPath}/js/ajaxfileupload.js"></script>
		<script src="${rc.contextPath}/bootstrap/js/bootstrap.min.js"></script>
		<!--[if lte IE 8]>
		    <script type="text/javascript" src="${rc.contextPath}/js/excanvas.js"></script>
		<![endif]-->
	</head>

	<body>
		<div id="body">
		
			#parse("header.html")
			
			<!-- end #header -->
			<div id="container">

				<div class="content_mid">
					<dl class="c_section c_section_mid">
						<dt>
                    <h2><em></em>企业用户公司绑定</h2>
                </dt>
						<dd class="c_certify">
							<form action="${rc.contextPath}/user/enterprise/bindcompany" method="post" id="bindForm">
							<h3>公司名称</h3>
							<input type="text" id="autoshowCompany" name="company_name" placeholder="请输入公司名称"  style="padding: 0px" required="required"/>
							<input type="hidden" id="company_id" name="company_id"/>
							<span>注：如果该公司之前未在城建就业网认证，请先去<a href="${rc.contextPath}/user/enterprise/addcompany" target="_blank" style="font-size: 16px;"><b>填写公司信息</b></a></span>
							<h4>申请绑定公司的标准任选一</h4>
							<ul class="c_certify_list">
								<li class="list1">公司工卡<span>[ 所在公司的工卡 ]</span></li>
								<li class="list2">公司邮箱登录截图<span>[ 注册绑定的邮箱登录公司邮箱后的截图]</span></li>
								<li class="list3">带有公司公章的证明照片</li>
								<li class="list4">
									公司的营业执照
									<div class="list4_child">
										<span>*</span>
										<div>
											4.1请提供有效年检期内的《企业法人营业执照》副本<br> 4.2为保证信息安全，审核执照不提供预览功能，请谅解
											<br> 4.3该营业执照城建就业指导网只用作公司绑定使用，请放心上传
										</div>
									</div>
								</li>
							</ul>
							
							<input type="file" name="selectfile" id="selectfile" onchange="ajaxfileuploadCheckFile();" >
							<input type="hidden" name="checkfile" id="checkfile" value=""/>
							<img alt="" src="" id="show_checkfile">
							<input type="submit" class="btn_32" value="提交绑定" />
							</form>
						</dd>
					</dl>
				</div>

				<div class="clear"></div>
				<a rel="nofollow" title="回到顶部" id="backtop" style="display: none;"></a>
			</div>
			<!-- end #container -->
		</div>
		<!-- end #body -->
	


		<!--  -->

		
	</body>
	<script type="text/javascript">
	
	//自动 补全方法  
    $("#autoshowCompany").autocomplete({  
      minLength:1,
      source: function(request,response){
     	 jQuery.ajax({  
     	        type:'get',  
     	        contentType: "application/json",  
     	        url: "${rc.contextPath}/company/autoshow?keyword="+$("#autoshowCompany").val(),  
     	        dataType: "json",  
     	        success:function(data){
     	        	for(var i = 0;i<data.companyList.length;i++){
     	        		console.log(data.companyList[i].company_name);
     	        	}
     	        	console.log(data.companyList);
     	        	response( jQuery.map(data.companyList, function(item) {
     	                return {
     	                  company_name: item.company_name,
     	                  id: item.id
     	                }
     	              }));  
     	        }  
     	      });  
      },
      focus: function(event, ui) {
          $("#autoshowCompany").val(ui.item.company_name);
          return false;
      },
      select: function(event, ui) {
          $("#autoshowCompany").val(ui.item.company_name);
          $("#company_id").val(ui.item.id);
          return false;
      }
    }).data( "ui-autocomplete" )._renderItem = function( ul, item ) {
 	      return $( "<li>" )
 	        .append( "<a>" + item.company_name + "</a>" )
 	        .appendTo( ul );
 	    };;  
	
	
	function ajaxfileuploadCheckFile(){
		jQuery.ajaxFileUpload(
			{
				type:'post',
				url:"${rc.contextPath}/admin/uploadImage/2",
				secureuri:false,
				fileElementId:"selectfile",
				/* dataType:"json", */
				success:function(data,status){
					var str = $(data).find("body").text();
					var json = jQuery.parseJSON(str);
					if(json.code==800){
						$("#checkfile").val(json.info);
						$("#show_checkfile").attr("src","http://127.0.0.1:8080/image/checkfile/"+json.info);  
					}else{
						alert(json.code+json.info);
					}
					//alert(data.info);
				},
				error:function(data,status,e){
				}
			}					
		)
	}
	  
     
	</script>

</html>